#第一题
import requests
import re
response = requests.get('https://www.sanchuangedu.cn')
response.encoding = 'utf8'
picture = re.findall(r"(?<=img src=).*(?= width=)",response.text)
for i in picture:
    url1 = "https://www.sanchuangedu.cn/" + i
    scpicture = requests.get(url1).content
    with open(i, "wb") as fp:
            fp.write(scpicture)
#第二题
from ping3 import ping
import IPy
import threading

ip = '192.168.1.0/24'

def my_ping(ip):
    result = ping(ip)
    if result:
        print(ip)

t_lst = []
for ip in IPy.IP(ip):
    t = threading.Thread(target=my_ping, args=(str(ip), ))
    t_lst.append(t)
    t.start()
for t in t_lst:
    t.join()
